#include <Model\Include\Ball.h>
#include <math.h>

Ball::Ball(const float &pos_x, const float &pos_y, const float &initial_orientation, const float &velocity, const float &radio)
    :GameObject(pos_x, pos_y, initial_orientation)
{
    this->velocity = velocity;
    this->radio = radio;
}


Ball::~Ball(void)
{
}

void Ball::move(const float &delta_time)
{
    float delta_movement = velocity /*units/sec*/ * delta_time /*msec*/ * 0.001f /*sec/msec*/;
    float delta_x = cos(this->getOrientation()) * delta_movement;
    float delta_y = sin(this->getOrientation()) * delta_movement;

    this->setPosition( this->getPositionX() + delta_x, this->getPositionY() + delta_y );
}

float Ball::getRadio()
{
    return this->radio;
}
